package com.CMC.yhdeng;

import java.io.IOException;
import java.io.Serializable;

import android.util.JsonReader;

public class ExamUnitContent extends UnitBase implements Serializable{
	private static final long serialVersionUID = 2L;
	public enum ExamType{
		UNKNOWN, WORD2KK, SOUND2WORD, WORD2SOUND, KK2SOUND, KK2WORD
	}
	public long number, time;
	public	ExamType type;
	private int current=0;
	public int getCurrent() {
		return current;
	}
	public void setCurrent(int current) {
		this.current = current;
	}
//	public 
	public Boolean read(JsonReader reader)throws IOException{
		reader.beginObject();
		
		readBaseMember(reader, "exam_id", "exam_title");
		
		String types=readStringFromTag(reader, "exam_type");
		
		if(types.compareTo("word2kk")==0) type=ExamType.WORD2KK;
		else if(types.compareTo("sound2word")==0) type=ExamType.SOUND2WORD;
		else if(types.compareTo("kk2word")==0) type=ExamType.KK2WORD;
		else if(types.compareTo("word2sound")==0) type=ExamType.WORD2SOUND;
		else if(types.compareTo("kk2sound")==0) type=ExamType.KK2SOUND;
		else type=ExamType.UNKNOWN;
		
		number=Long.decode(readStringFromTag(reader, "exam_number"));
		
		time=Long.decode(readStringFromTag(reader, "exam_time"));
		
		reader.endObject();

		return true;
	}
}
